package com.baiwang.web.controller;
import com.baiwang.web.domain.Result;
import com.baiwang.web.domain.vo.OutputInvoiceIssueVO;
import com.baiwang.web.service.OutputInvoiceIssueService;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.io.FileNotFoundException;

/** 发票开具
 * @author zhanliuzhu
 * @date 2024/4/17
 */
@Slf4j
@RestController
@RequestMapping("/output/invoice")
public class OutputInvoiceIssueController {


    @Autowired
    private OutputInvoiceIssueService outputInvoiceIssueService;


    /**
     * 发票开具
     */
    @PostMapping("/issue")
    public Result issueInvoice(@Valid @RequestBody OutputInvoiceIssueVO invoiceIssueVO) throws JsonProcessingException, FileNotFoundException {
        return outputInvoiceIssueService.issueInvoice(invoiceIssueVO);
    }


}
